<include file="Public/header" />

	</head>

	<body>
		<!--page容器-->
		<div class="page-group">
			<div class="page page-current">
	       <header class="bar bar-nav">
    <a class="button button-link button-nav pull-left back" href="javascript:window.history.go(-1)">
      <span class="icon icon-left"></span>
    </a>
    <h1 class="title">预约学车</h1>
    <a class="button button-link button-nav pull-right" href="/">
                <span class="icon icon-home"></span>
    </a>
</header>
				<div class="content">
					<div class="time">
						<span>请选择时间</span><input type="text" name="date-time" id="date-time" readonly="true" value="{$time}"/>
					</div>
					<div class="automated">
						<div class="ds-title">
							教练排班
						</div>
							<div class="list-block media-list ds-list" id="MemberInfo">
                   			<input type="hidden" name="num" id="num" value="{$num}">
                   			<input type="hidden" name="sc_id" id="sc_id" value="{$sc_id}">
                			</div>
					</div>

				 <div id="more" class="more" ><p>加载更多</p></div>
                </div>
		<script src="__PUBLIC__/app/lib/datePicker.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
		var p=1;
		var theSelectData='{$time}';
        var num=$('#num').val();
        var school_id=$('#sc_id').val();
         $(function(){
        	 getMore(p,theSelectData,school_id);
        	 if(p >= num){
                 $("#more").hide();
            }
        });

        $("#more").click(function(){
            getMore(++p,theSelectData,school_id);
            if(p >= num){
                 $("#more").hide();
            }
        });
		
			var calendar = new datePicker();
			calendar.init({
				'trigger': '#date-time',
				/*按钮选择器，用于触发弹出插件*/
				'type': 'date',
				/*模式：date日期；datetime日期时间；time时间；ym年月；*/
				'minDate': '1900-1-1',
				/*最小日期*/
				'maxDate': '2100-12-31',
				/*最大日期*/
				'onSubmit': function() { /*确认时触发事件*/
					 theSelectData = calendar.value;
					p = 1;
					//console.log(p,theSelectData);
					getMoreD(p,theSelectData,school_id);
					
					
				},
				'onClose': function() { /*取消时触发事件*/ }
			});
			
		

        function getMore(p,date,school_id){
            $.ajax({
                url:"{:U('sc_info')}",
                data:{p:p,date:date,school_id:school_id},
                type:'post',
                success:function(data){
                    $("#MemberInfo").append(data);
                }
            });

        }
        
        function getMoreD(p,date,school_id){
        	var url = "__APP__/Home/Appointment/sc_app/date/"+theSelectData+"/school_id/"+school_id;
			location.href=url;

        }

		</script>
		<script src="http://cdn.bootcss.com/zepto/1.1.6/zepto.min.js"></script>
		<script src="__PUBLIC__/app/lib/h5jssdk.3.0.js"></script>
	</body>

<include file="Public/footer" />